{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/ContactControl/index.tsx\",\n  _s = $RefreshSig$();\nimport React from 'react';\nimport { observer } from \"mobx-react-lite\";\nimport { Context } from \"../../index\";\nimport { findContactOrReturnNull } from \"../../utils/Contact\";\nimport './ContactControl.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-dev-runtime\";\nconst ContactControl = props => {\n  _s();\n  const {\n    store\n  } = React.useContext(Context);\n  const [findContactWithIndex, setFindContactWithIndex] = React.useState({\n    contact: null\n  });\n  React.useEffect(() => {\n    if (!props.selfProfile && store.getProfile().id !== props.profile.id) {\n      let contactItem = findContactOrReturnNull(props.profile, store.getProfile(), store.getContacts());\n      setFindContactWithIndex({\n        ...findContactWithIndex,\n        ...contactItem\n      });\n      console.log(findContactWithIndex);\n    }\n  }, [store.getContacts()]);\n  if (!props.selfProfile && store.getProfile().id !== props.profile.id) {\n    return /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"contact__control\"\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 28,\n      columnNumber: 13\n    }, this);\n  } else {\n    return /*#__PURE__*/_jsxDEV(_Fragment, {}, void 0, false);\n  }\n};\n_s(ContactControl, \"1rkpGNxih+s2FOgveg1/4RhS4mM=\");\n_c = ContactControl;\nexport default _c2 = observer(ContactControl);\nvar _c, _c2;\n$RefreshReg$(_c, \"ContactControl\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","observer","Context","findContactOrReturnNull","ContactControl","props","store","useContext","findContactWithIndex","setFindContactWithIndex","useState","contact","useEffect","selfProfile","getProfile","id","profile","contactItem","getContacts","console","log"],"sources":["/data/messenger.client/src/components/ContactControl/index.tsx"],"sourcesContent":["import React from 'react';\nimport {observer} from \"mobx-react-lite\";\nimport {Context} from \"../../index\";\nimport {findContactOrReturnNull} from \"../../utils/Contact\";\nimport {UserProfileProps} from \"../../models/props/UserProfileProps\";\nimport {ContactWithIndex} from \"../../models/props/ContactWithIndex\";\nimport './ContactControl.scss';\n\nconst ContactControl: React.FC<UserProfileProps> = (props) => {\n    const {store} = React.useContext(Context);\n    const [findContactWithIndex, setFindContactWithIndex] = React.useState<ContactWithIndex>({contact: null});\n\n    React.useEffect(() => {\n        if (!props.selfProfile && store.getProfile().id !== props.profile.id) {\n            let contactItem = findContactOrReturnNull(props.profile, store.getProfile(), store.getContacts());\n            setFindContactWithIndex({\n                ...findContactWithIndex,\n                ...contactItem\n            });\n\n            console.log(findContactWithIndex)\n        }\n    }, [store.getContacts()]);\n\n    if (!props.selfProfile && store.getProfile().id !== props.profile.id) {\n\n        return (\n            <div className=\"contact__control\">\n\n            </div>\n        );\n    } else {\n        return (<></>);\n    }\n}\n\nexport default observer(ContactControl);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,QAAQ,QAAO,iBAAiB;AACxC,SAAQC,OAAO,QAAO,aAAa;AACnC,SAAQC,uBAAuB,QAAO,qBAAqB;AAG3D,OAAO,uBAAuB;AAAC;AAAA;AAE/B,MAAMC,cAA0C,GAAIC,KAAK,IAAK;EAAA;EAC1D,MAAM;IAACC;EAAK,CAAC,GAAGN,KAAK,CAACO,UAAU,CAACL,OAAO,CAAC;EACzC,MAAM,CAACM,oBAAoB,EAAEC,uBAAuB,CAAC,GAAGT,KAAK,CAACU,QAAQ,CAAmB;IAACC,OAAO,EAAE;EAAI,CAAC,CAAC;EAEzGX,KAAK,CAACY,SAAS,CAAC,MAAM;IAClB,IAAI,CAACP,KAAK,CAACQ,WAAW,IAAIP,KAAK,CAACQ,UAAU,EAAE,CAACC,EAAE,KAAKV,KAAK,CAACW,OAAO,CAACD,EAAE,EAAE;MAClE,IAAIE,WAAW,GAAGd,uBAAuB,CAACE,KAAK,CAACW,OAAO,EAAEV,KAAK,CAACQ,UAAU,EAAE,EAAER,KAAK,CAACY,WAAW,EAAE,CAAC;MACjGT,uBAAuB,CAAC;QAC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